package com.ruoyi.oa.domain;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 教师请假对象 manage_leave_teacher
 *
 * @author 张艳羽
 * @date 2024-10-10
 */
public class LeaveTeacher extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** ID */
    private Long id;

    /** 请假教师ID */
    @Excel(name = "请假教师ID")
    private Long leaverId;

    /** 原因 */
    @Excel(name = "原因")
    private String reason;

    /** 请假类型 */
    @Excel(name = "请假类型")
    private String type;

    /** 审批人ID */
    @Excel(name = "审批人ID")
    private Long approverId;

    /** 请假开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @Excel(name = "请假开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startTime;

    /** 请假结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    @Excel(name = "请假结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endTime;

    /** 请假时长 */
    @Excel(name = "请假时长")
    private Float duration;

    /** 请假时长类型（D天 H小时） */
    @Excel(name = "请假时长类型", readConverterExp = "D=天,H=小时")
    private String durType;

    /** 请假状态（0已申请 1已通过 2被驳回） */
    @Excel(name = "请假状态", readConverterExp = "0=已申请,1=已通过,2=被驳回")
    private String status;

    @Excel(name = "请假人", targetAttr = "userName", type = Excel.Type.EXPORT)
    private SysUser leaver;
    private SysUser approver;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setLeaverId(Long leaverId)
    {
        this.leaverId = leaverId;
    }

    public Long getLeaverId()
    {
        return leaverId;
    }
    public void setReason(String reason)
    {
        this.reason = reason;
    }

    public String getReason()
    {
        return reason;
    }
    public void setType(String type)
    {
        this.type = type;
    }

    public String getType()
    {
        return type;
    }
    public void setApproverId(Long approverId)
    {
        this.approverId = approverId;
    }

    public Long getApproverId()
    {
        return approverId;
    }
    public void setStartTime(Date startTime)
    {
        this.startTime = startTime;
    }

    public Date getStartTime()
    {
        return startTime;
    }
    public void setEndTime(Date endTime)
    {
        this.endTime = endTime;
    }

    public Date getEndTime()
    {
        return endTime;
    }

    public Float getDuration() {
        return duration;
    }

    public void setDuration(Float duration) {
        this.duration = duration;
    }

    public String getDurType() {
        return durType;
    }

    public void setDurType(String durType) {
        this.durType = durType;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    public String getStatus()
    {
        return status;
    }

    public SysUser getLeaver() {
        return leaver;
    }

    public void setLeaver(SysUser leaver) {
        this.leaver = leaver;
    }

    public SysUser getApprover() {
        return approver;
    }

    public void setApprover(SysUser approver) {
        this.approver = approver;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("leaverId", getLeaverId())
                .append("reason", getReason())
                .append("type", getType())
                .append("approverId", getApproverId())
                .append("startTime", getStartTime())
                .append("endTime", getEndTime())
                .append("duration", getDuration())
                .append("status", getStatus())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }
}
